package com.hopes.bizz.risk.transfer.constant;

import com.hopes.bizz.risk.transfer.validation.group.SeqFour;
import com.hopes.bizz.risk.transfer.validation.group.SeqOne;
import com.hopes.bizz.risk.transfer.validation.group.SeqThree;
import com.hopes.bizz.risk.transfer.validation.group.SeqTwo;

import java.util.*;

/**
 * @author lyb
 * @version 1.0
 * @description: 常量
 * @date 2024/1/31 16:54
 */
public class RiskConstant {
    /**
     * 请求头认证 key
     **/
    public static final String HEADER_AUTHORIZATION = "Authorization";
    /**
     * 企业编码长度
     **/
    public static final int COMPANY_CODE_LEN = 10;
    /**
     * token认证时间长度
     **/
    public static final int TOKEN_DATE_LEN = 17;

    /**
     * token认证时间有效期 (小时)
     **/
    public static final int TOKEN_VALIDITY = 1;
    /**
     * token认证时间长度
     **/
    public static final int REQUEST_SIZE_LIMIT = 1024 * 1024 * 15;
    /**
     * token认证时间格式化
     **/
    public static final String FORMAT_TOKEN_DATE = "yyyyMMddHHmmssSSS";

    /**
     * 校验分隔符
     **/
    public static final String VALIDATOR_JOIN = ":#";


    // ============================================================================>

    /**
     * 隐患排查任务类型 --日常任务
     **/
    public static final String RISK_WORK_TYPE_DAILY_TASK = "0";
    /**
     * 隐患排查任务类型 --主要负责人
     **/
    public static final String RISK_WORK_TYPE_PRINCIPAL_TASK = "1";
    /**
     * 隐患排查任务类型 --主要负责人任务项
     **/
    public static final String[] RISK_WORK_TYPE_PRINCIPAL_TASK_ITEM = new String[]{"1", "2", "3", "4", "5", "6", "7", "8", "9"};
    /**
     * 隐患排查任务类型 --技术负责人
     **/
    public static final String RISK_WORK_TYPE_TECHNICAL_LEAD_TASK = "2";
    /**
     * 隐患排查任务类型 --技术负责人任务项
     **/
    public static final String[] RISK_WORK_TYPE_TECHNICAL_LEAD_TASK_ITEM = new String[]{"1", "2", "3", "4", "5", "6", "7", "8", "9"};
    /**
     * 隐患排查任务类型 --操作负责人
     **/
    public static final String RISK_WORK_TYPE_OPERATIONS_MANAGER_TASK = "3";
    /**
     * 隐患排查任务类型 --操作负责人任务项
     **/
    public static final String[] RISK_WORK_TYPE_OPERATIONS_MANAGER_TASK_ITEM = new String[]{"1", "2", "3", "4", "5", "6", "7", "8", "9", "10"};

    // ============================================================================>
    /**
     * 隐患状态 --已验收
     **/
    public static final String HID_STATUS_CHECK = "9";

    /**
     * 措施分类
     **/
    public static final Map<String, List<String>> RISK_MEASURES_CLASSIFY_MAP = new HashMap<>();

    // ============================================================================>
    /**
     * 风险数据传输处理状态  -- 处理中
     **/
    public static final Integer RISK_TRANSFER_HANDLER_STATUS_PROCESSING = 1;
    /**
     * 风险数据传输处理状态  -- 处理完成且成功
     **/
    public static final Integer RISK_TRANSFER_HANDLER_STATUS_COMPLETED_SUCCESSFULLY = 2;
    /**
     * 风险数据传输处理状态  -- 处理完成且失败
     **/
    public static final Integer RISK_TRANSFER_HANDLER_STATUS_COMPLETED_FAILED = 3;

    // ============================================================================>

    public static final String KEY_QUEUE_RISK = "MQ:RISK";


    // ============================================================================>

    public static final List<Class<?>> VALIDATE_GROUP_LIST = new ArrayList<>();

    static {
        RISK_MEASURES_CLASSIFY_MAP.put("1", Arrays.asList("1-1", "1-2", "1-3", "1-4", "1-5"));
        RISK_MEASURES_CLASSIFY_MAP.put("2", Arrays.asList("2-1", "2-2", "2-3"));
        RISK_MEASURES_CLASSIFY_MAP.put("3", Arrays.asList("3-1", "3-2", "3-3", "3-4"));
        RISK_MEASURES_CLASSIFY_MAP.put("4", Arrays.asList("4-1", "4-2", "4-3", "4-4", "4-5"));

        VALIDATE_GROUP_LIST.add(SeqOne.class);
        VALIDATE_GROUP_LIST.add(SeqTwo.class);
        VALIDATE_GROUP_LIST.add(SeqThree.class);
        VALIDATE_GROUP_LIST.add(SeqFour.class);
    }
}
